
import Taro, {Component} from '@tarojs/taro'
import {Image, View} from '@tarojs/components'
import {getRuntime} from '../utils/common'
import share_icon from "../assets/img/share_arrow.png";
import close_icon from "../assets/img/icon_close_bold.png";

// 举报组件
class ShareModel extends Component {
  constructor(props){
    super(props)
  }

  state = {
    isShare: false
  }

  componentWillMount(): void {
    let isShare = this.props.isShare
    this.setState({ isShare })
  }

  onClose() {
    this.props.onClose(false)
  }

  render() {
    let { isShare } = this.state
    return (
      <View>
        <View className={isShare?'share-arrow share-arrow-active':'share-arrow'}>
          <Image className='share-arrow-icon' src={share_icon} />
          <View className='con'>
            <View>请点击右上角</View>
            <View>通过【发送给朋友】</View>
            <View>分享给好友</View>
          </View>
          <Image className='close-icon' onClick={this.onClose.bind(this)} src={close_icon} />
        </View>
      </View>
    )
  }
}

export default ShareModel

